{extend name="index@common/base"/}
{block name="style"}
{/block} {block name="body"}
<div class="layui-body layui-tab-content index-body" id="cont">
	<div class="park-navigation">
		<div class="navigation-icon">
			<i class="fa {$breadCrumb[0]['icon']}"></i>
		</div>
		<div class="navigation-menu">
			<h2>{$breadCrumb[0]['title']}</h2>
			{if isset($breadCrumb[1])}
			<p>{$breadCrumb[0]['remark']}</p>
			{/if}
		</div>
		<div class="navigation-page">
			<ul>
				<li class="this" data-type="camera">摄像头</li>
				<li data-type="sensor">传感器</li>
			</ul>
		</div>
	</div>
	<div class="park-content" id="page-camera">
		<div class="content-title">
			<div class="title col-8">
				<h3>{$breadCrumb[1]['title']}</h3>
				<form class="layui-form" action="{:url('basic/detection/search')}"  onsubmit="return false;">
					<button class="search-btn" lay-submit lay-filter="search"><img src="__STATIC__/img/base/topsearch01.png"></button>
					<select name="enterpriseId">
						<option></option>
						{volist name="enterpriseList" id="item"}
						<option value="{$key}">{$item}</option>
						{/volist}
					</select>
					<input class="search-input" name="keyword" type="text" placeholder="设备编号" id="keyword"  autocomplete="off">
				</form>	
			</div>
			<div class="tool col-2">
				<button id="add"  data-url="{:url('basic/detection/add')}"><i class="fa fa-plus"></i></button>
				<button class="reload"><i class="fa fa-refresh"></i></button>
			</div>
		</div>
		<table class="layui-hide" id="detection" lay-filter="detection" data-camera_url="{:url('basic/detection/index')}" data-sensor_url="{:url('basic/detection/sensor')}"></table>
	</div>
	<div class="park-content page-hide" id="page-sensor">
		<div class="content-title">
			<div class="title col-9">
				<h3>{$breadCrumb[1]['title']}</h3>
				<form class="layui-form" action="{:url('basic/detection/sensor')}"  onsubmit="return false;">
					<button class="search-btn" lay-submit lay-filter="search"><img src="__STATIC__/img/base/topsearch01.png"></button>
					<input class="search-input" name="keyword" type="text" placeholder="传感器" id="keyword"  autocomplete="off">
				</form>	
			</div>
			<div class="tool col-1">
				<button class="reload"><i class="fa fa-refresh"></i></button>
			</div>
		</div>
		<table class="layui-hide" id="sensor" lay-filter="sensor" data-sensor_url="{:url('basic/detection/sensor')}"></table>
	</div>
</div>
{/block}
{block name="script"}

<script type="text/javascript" src="__JS__/basic/detection.js"></script>


<script type="text/html" id="toolDemo">
	<div>
		<a class="layui-btn btn-edit" lay-event="edit" id="edit_{{d.id}}" data-url="{:url('basic/detection/edit')}?detectionId={{d.id}}"><i class="fa fa-pencil"></i></a>
  		<a class="layui-btn btn-del" lay-event="del" id="del_{{d.id}}" data-url="{:url('basic/detection/del')}?detectionId={{d.id}}"><i class="fa fa-trash"></i></a>
	</div>
</script>
<script type="text/html" id="status">
	<div>
		<br/>
		{{# if (d.isValid == 1){ }}
		<p>有效性: <span class="layui-badge-circle layui-bg-green"><i class="fa fa-check"></i></span></p>
		{{# }else{ }}
		<p>有效性: <span class="layui-badge-circle layui-bg-red"><i class="fa fa-close"></i></span></p>
		{{# } }}
		<br/>
		
		{{# if (d.status == 1){ }}
		<p>状态: <span class="layui-badge-square layui-bg-green">正常<i class="fa fa-check"></i></span></p>
		{{# } }}
		{{# if (d.status == 2){ }}
		<p>状态: <span class="layui-badge-square layui-bg-yellow">维修中<i class="fa fa-wrench"></i></span></p>
		{{# } }}
		{{# if (d.status == 3){ }}
		<p>状态: <span class="layui-badge-square layui-bg-gray">禁用<i class="fa fa-ban"></i></span></p>
		{{# } }}
		{{# if (d.status == 4){ }}
		<p>状态: <span class="layui-badge-square layui-bg-red">已报废<i class="fa fa-trash-o"></i></span></p>
		{{# } }}
		<br/>
	</div>
</script>

<script type="text/html" id="imgTemplate">
	{{# if (d.imgPath){ }}
		<img src="__PUBLIC__{{d.imgPath}}"></img>
	{{# } }}
</script>
<script type="text/html" id="enterpriseTemplate">
	{{# if (d.enterprise){ }}
	<span>{{d.enterprise.fullName}}</span>
	{{# } }}
</script>
<script type="text/html" id="dangerSourceTemplate">
	{{# if (d.danger_source){ }}
	<span>{{d.danger_source.name}}</span>
	{{# } }}
</script>

<script type="text/html" id="cameraCode">
	{{# if (d.cameraCode){ }}
	 <a href="#" class="camera" data-url="{:url('basic/detection/camera')}?detectionId={{d.id}}" style="color:#1e9fff">{{d.cameraCode}}</a>
	{{# } }}
</script>
<script type="text/html" id="alarm">
	{{# if (d.status == 1){ }}
		<p><span class="layui-badge layui-bg-green">正常</span></p>
	{{# }else{ }}
		<p><span class="layui-badge layui-bg-red">异常</span></p>
	{{# } }}
</script>
{/block}

